﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using libsemtd;

namespace libbacktrack
{
    public partial class Backtrack
    {
        public Backtrack() { throw new NotImplementedException(); }
        public Backtrack(string graphType, int numVerMain, int numVerDef, int firstLabel, bool isRecurseAll)
        {
            this.result = "";
            this.myGraph = new Semtd(graphType, numVerMain, numVerDef);
            this.labelVerUsed = new bool[this.myGraph.NumVerTotal + 1];
            this.isRecurseAll = isRecurseAll;
            setLabel(0, firstLabel);
            this.firstLabel = firstLabel;
            this.pathLabel = this.pathStart = this.pathEnd = 0;
            switch (graphType)
            {
                case "fan":
                    {
                        this.pathStart = 1;
                        this.pathEnd = this.myGraph.NumVerMain - 1;
                        break;
                    }
                case "wheel":
                case "doubefan":
                    {
                        this.pathStart = 2;
                        this.pathEnd = this.myGraph.NumVerMain - 1;
                        break;
                    }
            }
        }
    }
}
